import { _decorator, Component, Node } from "cc";
const { ccclass, property } = _decorator;
export enum RewardType2 {
  // 伤害增加
  Damage,
  // 子弹速度
  BulletSpeed,
  // 生成子弹速度
  ShootSpeed,
}

@ccclass("Reward2")
export class Reward2 extends Component {
  @property
  rewardType: RewardType2 = RewardType2.Damage;
  @property
  speed: number = 80;

  update(deltaTime: number) {
    const p = this.node.position;
    this.node.setPosition(p.x, p.y - this.speed * deltaTime, p.z);
    if (this.node.position.y < -580) {
      this.node.destroy();
    }
  }
}
